package com.whfc.wxmp.api.fse.service.impl;

import com.whfc.entity.param.warn.AppWarnHandleParam;
import com.whfc.fse.dto.FseWarnDetailDTO;
import com.whfc.fse.service.FseWarnService;
import com.whfc.fuum.entity.SysUser;
import com.whfc.fuum.entity.WxUser;
import com.whfc.wxmp.api.fse.service.WxFseWarnService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @author: xugcheng
 * @version: 1.0
 * @date: 2020-11-02 17:33
 */
@Service
public class WxFseWarnServiceImpl implements WxFseWarnService {

    @DubboReference(interfaceClass = FseWarnService.class, version = "1.0.0")
    private FseWarnService fseWarnService;

    @Override
    public FseWarnDetailDTO getFseWarnDetail(Integer warnId) {
        FseWarnDetailDTO detailDTO = fseWarnService.recordDetail(warnId);
        return detailDTO;
    }

    @Override
    public void handleFseWarn(WxUser loginUser, AppWarnHandleParam body) {
        SysUser user = new SysUser();
        user.setId(loginUser.getId());
        user.setPhone(loginUser.getPhone());
        user.setUsername(loginUser.getNickName());
        fseWarnService.recordHandle(user, body);
    }
}
